package System;

import java.util.Scanner;




import TestesDeAceitacao.SystemFacade;

public class Principal {
	
	private static SystemFacade f;
	
	public static void main(String[] args) throws Exception {
	
		f = new SystemFacade();
		inicio();
	}
	
	private static void inicio() throws Exception {
		Scanner sc = new Scanner(System.in);

		System.out.println();
		System.out.println("*********************************");
		System.out.println("********** SI1Project **********");
		System.out.println("*********************************");
		System.out.println("1 - Fazer Login");
		System.out.println("2 - Novo Usuário");
		System.out.println("3 - Sair");

		switch(sc.nextInt()){

		case 1:
			login();
		case 2:
			createUser();
		case 3:
			System.exit(0);
		}
	}
	
	public static void login() throws Exception{

		Scanner sc = new Scanner(System.in);

		System.out.println();
		System.out.println(">>>>> LOGIN <<<<<");
		System.out.print("_login: ");
		String login = sc.nextLine();

		f.abrirSessao(login);
	}
	
	private static void createUser() throws Exception{

		Scanner sc = new Scanner(System.in);
		System.out.println();
		System.out.println(">>>>> NOVO USUARIO <<<<<");
		System.out.print("_Nome: ");
		String nome = sc.nextLine();
		System.out.print("_login: ");
		String login = sc.nextLine();
		System.out.println("_endereco: ");
		String endereco = sc.nextLine();

		f.criarUsuario(login, nome, endereco);
		inicio();
	}
	

}
